package com.qianli.user.enums;

/**
 * @program: cashmama-user
 * @description
 * @author: frank
 * @create: 2020-02-01 15:29
 **/
public enum UserAuthStatusEnum {

    INIT(0, "初始化"),
    SUCCESS(1, "认证成功"),
    FAIL(2, "认证失败"),
    TRY_AGAIN(3, "重新认证"),
    PROCESSING(4, "处理中"),
    REJECT(5, "认证拒绝");


    UserAuthStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public UserAuthStatusEnum setCode(Integer code) {
        this.code = code;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public UserAuthStatusEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static UserAuthStatusEnum getByCode(Integer code){
        UserAuthStatusEnum userAuthStatusEnum = null;
        for(UserAuthStatusEnum authStatusEnum : UserAuthStatusEnum.values()){
            if(authStatusEnum.getCode() == code){
                userAuthStatusEnum = authStatusEnum;
                break;
            }
        }
        return userAuthStatusEnum;
    }
}
